<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>竞赛调考强化训练系统</title>
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="keywords" content="">
<!--<link rel="shortcut icon" href="http://localhost:8080/Portal/../resources/images/favicon.ico" />-->
<link href="resources/bootstrap/css/bootstrap-huan.css" rel="stylesheet">
<link href="resources/font-awesome/css/font-awesome.min.css"
	rel="stylesheet">
<link href="resources/css/style.css" rel="stylesheet">

<style>
.table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td,
	.table>tbody>tr>td, .table>tfoot>tr>td {
	padding: 8px 0;
	line-height: 1.42857143;
	vertical-align: middle;
	border-top: 1px solid #ddd;
}

a.join-practice-btn {
	margin-top: 0;
}
</style>

</head>

<body>
	<header>
		<div class="container">
			<div class="row">
				<div class="col-xs-5">
					<div class="logo">
						<h1>
							<a href="#"><img alt="" src="resources/images/logo.png"></a>
						</h1>
					</div>
				</div>
				<div class="col-xs-7" id="login-info">
					<c:choose>
							<c:when test="${not empty sessionScope.SPRING_SECURITY_CONTEXT.authentication.principal.username}">
								<div id="login-info-user">
									
									<a href="user-detail/${sessionScope.SPRING_SECURITY_CONTEXT.authentication.principal.username}" id="system-info-account" target="_blank">${sessionScope.SPRING_SECURITY_CONTEXT.authentication.principal.trueName}</a>
									<span>|</span>
									<a href="j_spring_security_logout"><i class="fa fa-sign-out"></i> 退出</a>
								</div>
							</c:when>
							<c:otherwise>
								<a class="btn btn-primary" href="user-register">用户注册</a>
								<a class="btn btn-success" href="user-login-page">登录</a>
							</c:otherwise>
					</c:choose>
				</div>
			</div>
		</div>
	</header>
	<!-- Navigation bar starts -->

		<jsp:include page="common/menu.jsp"></jsp:include>

	<!-- Navigation bar ends -->
	<div class="full-slider">
			<!-- Slider (Flex Slider) -->
			<div class="container">
				<div class="row">
					<div class="col-md-12">
						<div class="flexslider" style=" min-height: 110px;">
							<div class="flex-caption">
								<!-- Left column -->
								<div class="col-l">
									<p style="text-indent:2em;">
										本系统的开发与建设，主要目的是为提升国网甘肃省电力公司竞赛抽调考整体水平，最大限度的挖掘参赛选手的参赛潜能，解决学员在题库收集、资料整理、强化记忆过程中遇到的难点，为公司竞赛调考取得好成绩做好基础保障。
									</p>
								</div>
								<!-- Right column -->
								<div class="col-r">

									<!-- Use the class "flex-back" to add background inside flex slider -->

									<!-- <img alt="" src="../resources/images/ad.png"> -->
									<p style="text-indent:2em;">
										系统通过收集历年、历次国网竞赛抽调考试题，以及现有各专业典型题库，形成一套较为完整的、有针对性的竞赛抽调考试题库，让学员们在有限的时间内，高效精准的进行强化训练，增加训练的针对性与实效性。
									</p>

									<!-- Button -->
									<!-- <a class="btn btn-default btn-cta" href="user-register"><i class="fa fa-arrow-circle-down"></i> 马上加入我们吧</a> -->

								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
	</div>
	<!-- Slider starts -->
	<div class="content" style="margin-bottom: 100px;">
			<c:if test="${fn:length(newsList) > 0 }">
				<div class="container">
					<div>
						<h3>最新公告</h3>
					</div>
					<div style="margin-top: 20px;">
						<ul class="news-list">
							<c:choose>
								<c:when test="${fn:length(newsList) eq 1 }">
									<li class="news-list-item clearfix">
										<a class="home-link-anchor" href="news/${newsList[0].newsId }" target="_blank">
										<div class="news-list-thumbnail">
											<i style="  font-size: 60px;" class="fa fa-volume-up"></i>
										</div>
										<div class="news-list-content">
											<div class="news-list-title">
												${newsList[0].title }
											</div>
											<div class="news-list-creater">
												<i class="fa fa-user"></i><span>${newsList[0].creator }</span>
												<i class="fa fa-clock-o"></i><span><fmt:formatDate value="${newsList[0].createTime }" pattern="yyyy-MM-dd HH:mm"/></span>
											</div>
										</div> </a>
									</li>
								</c:when>
				<%-- 				<c:otherwise>
									<li class="news-list-item clearfix">
										<a class="home-link-anchor" href="news/${newsList[0].newsId }" target="_blank">
										<div class="news-list-thumbnail">
											<img src="http://www.examstack.com/resources/images/index/index3.jpg">
										</div>
										<div class="news-list-content">
											<div class="news-list-title"">
												${newsList[0].title }
											</div>
											<div class="news-list-creater">
												<i class="fa fa-user"></i><span>${newsList[0].creator }</span>
												<i class="fa fa-clock-o"></i><span><fmt:formatDate value="${newsList[0].createTime }" pattern="yyyy-MM-dd HH:mm"/></span>
											</div>
										</div> </a>
									</li>
									<li class="news-list-item clearfix">
										<a class="home-link-anchor" href="news/${newsList[1].newsId }">
										<div class="news-list-thumbnail">
											<img src="http://www.examstack.com/resources/images/index/index2.jpg">
										</div>
										<div class="news-list-content">
											<div class="news-list-title">
												${newsList[1].title }
											</div>
											<div class="news-list-creater">
												<i class="fa fa-user"></i><span>${newsList[1].creator }</span>
												<i class="fa fa-clock-o"></i><span><fmt:formatDate value="${newsList[1].createTime }" pattern="yyyy-MM-dd HH:mm"/></span>
											</div>
										</div> </a>
									</li>
								</c:otherwise> --%>
							</c:choose>
							
							
						</ul>
					</div>
				</div>
			</c:if>
		<div class="container">
			<%-- <ul class="nav nav-pills " style="margin: 20px 0;">
				<c:forEach items="${fieldList }" var="item">
					<li role="presentation" <c:if test="${item.fieldId == fieldId }"> class="active"</c:if>><a href="student/practice-list?fieldId=${item.fieldId }">${item.fieldName }</a></li>
				</c:forEach>
			</ul> --%>
			<div class="row">
				<a class="select-test col-xs-2 home-link-anchor" href="student/practice-test/${fieldId }/0">
						<div class="select-test-icon">
							<i class="fa fa-">1</i>
						</div> <h3> 试题初记 </h3>
						<p>
						</p> 
					</a>
					<a >
							<i class="fa fa-arrow-right"  style="float:left; color:rgb(102, 102, 102);font-size: 50px; line-height: 150px;"></i>
					</a>
					<a class="select-test col-xs-2 home-link-anchor" href="student/practice-improve/${fieldId }/0/1/0">
						<div class="select-test-icon">
							<i class="fa fa-">2</i>
						</div> <h3> 初阶训练 </h3>
						<p>
							（分类训练）
						</p> 
					</a>
						<a >
							<i class="fa fa-arrow-right"  style="float:left; color:rgb(102, 102, 102);font-size: 50px; line-height: 150px;"></i>
					</a>
					<a class="select-test col-xs-2 home-link-anchor" href="student/practice-incorrect/${fieldId }/1/0">
						<div class="select-test-icon">
							<i class="fa fa-">3</i>
						</div> <h3> 中阶训练 </h3>
						<p>
							（错题集中营）
						</p> 
					</a>
						<a >
							<i class="fa fa-arrow-right"  style="float:left; color:rgb(102, 102, 102);font-size: 50px; line-height: 150px;"></i>
					</a>
					<a class="select-test col-xs-2 home-link-anchor" href="student/practice-ksmx/${fieldId }/0/0">
						<div class="select-test-icon">
							<i class="fa fa-">4</i>
						</div> <h3> 高阶训练 </h3>
						<p>
							（苦思冥想）
						</p> 
					</a>
			</div>
		<%-- 	<div class="row">
				<div class="col-xs-6">
					<div style="border-bottom: 1px solid #ddd;">
						<h3 class="title">
							<i class="fa fa-cloud-upload"></i> 强化练习
						</h3>
						<p>自主选择具体考点，各个击破</p>
					</div>

					<div class="question-list">

						<c:forEach items="${kparl}" var="item">

							<table class="table-striped table">
								<thead>
									<tr>
										<td colspan="4"><h6>${item.knowledgePointName }</h6>
											<span style="color: #428bca;">学习进度：<fmt:formatNumber
													value="${item.finishRate }" type="percent" /></span></td>
									</tr>
									<tr>
										<td>题型</td>
										<td>全部</td>
										<td>已做题目</td>
										<td></td>
									</tr>
								</thead>
								<tbody>
									<c:forEach items="${item.typeAnalysis }" var="tp">
										<tr>
											<td>${tp.questionTypeName }</td>
											<td><span class="span-info question-number">${tp.restAmount + tp.rightAmount + tp.wrongAmount }</span></td>
											<td><span class="span-success question-number-2">${tp.rightAmount + tp.wrongAmount }</span></td>
											<td>
												<a href="student/practice-improve/${fieldId }/${item.knowledgePointId }/${tp.questionTypeId }/0"
													class="btn btn-success btn-sm join-practice-btn">参加练习(顺序)</a>
												<a href="student/practice-improve/${fieldId }/${item.knowledgePointId }/${tp.questionTypeId }/1"
													class="btn btn-info btn-sm join-practice-btn">参加练习(随机)</a>
											</td>
										</tr>
									</c:forEach>
								</tbody>
								<tfoot></tfoot>
							</table>
						</c:forEach>

					</div>
				</div>
				<div class="col-xs-6">
					<div style="border-bottom: 1px solid #ddd;">
						<h3 class="title">
							<i class="fa fa-eraser"></i> 错题练习
						</h3>
						<p>收录做过的所有错题</p>
					</div>
					<div class="question-list">

						<table class="table-striped table">
							<thead>

								<tr>
									<td>知识分类</td>
									<td>题目数量</td>
									<td></td>
									<td></td>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${historyMap }" var="item">
									<tr>
										<td>${pointMap[item.key].pointName }</td>
										<td><span class="span-info question-number">${item.value.wrongAmount }</span></td>
										<td>
										<a href="student/practice-incorrect/${item.value.fieldId }/${item.value.pointId }/0"
											class="btn btn-success btn-sm join-practice-btn">参加练习(顺序)</a>
										<a href="student/practice-incorrect/${item.value.fieldId }/${item.value.pointId }/1"
											class="btn btn-info btn-sm join-practice-btn">参加练习(随机)</a>
											</td>
									</tr>
								</c:forEach>

							</tbody>
							<tfoot></tfoot>
						</table>

					</div>
					<!--收藏练习s  -->
					<div style="border-bottom: 1px solid #ddd;">
						<h3 class="title">
							<i class="fa fa-heart"></i> 收藏练习
						</h3>
						<p>所有收藏的题目</p>
					</div>
					<div class="question-list">

						<table class="table-striped table">
							<thead>

								<tr>
									<td>知识分类</td>
									<td>题目数量</td>
									<td></td>
									<td></td>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${collectMap }" var="item">
									<tr>
										<td>${pointMap[item.key].pointName }</td>
										<td><span class="span-info question-number">${item.value.amount }</span></td>
										<td>
										<a href="student/practice-collect/${item.value.fieldId }/${item.value.pointId }/0"
											class="btn btn-success btn-sm join-practice-btn">参加练习(顺序)</a>
										<a href="student/practice-collect/${item.value.fieldId }/${item.value.pointId }/1"
											class="btn btn-info btn-sm join-practice-btn">参加练习(随机)</a>
										</td>
									</tr>
								</c:forEach>

							</tbody>
							<tfoot></tfoot>
						</table>

					</div>
					<!--收藏练习e-->
					
					<div style="border-bottom: 1px solid #ddd; margin-bottom: 20px;">
						<h3 class="title">
							<i class="fa fa-superscript"></i> 随机练习
						</h3>
						<p>从题库中随机取出试题练习</p>

					</div>
					<label >选择数量：</label>
					<select class="form-control" onchange = "changerHref(this)" style=" height: 32px;">
						<option>20</option>
						<option>50</option>
						<option>100</option>
					</select>
					<a class="btn btn-info " id="sjct" data-href="student/practice-test/${fieldId }" href="student/practice-test/${fieldId }/20">随机出题 </i>
					</a>
				</div>

			</div> --%>


		</div>

	</div>

	<footer>
		<jsp:include page="footer.jsp"></jsp:include>
	</footer>

	<!-- Slider Ends -->

	<!-- Javascript files -->
	<!-- jQuery -->
	<script type="text/javascript"
		src="resources/js/jquery/jquery-1.9.0.min.js"></script>
	<!-- Bootstrap JS -->
	<script type="text/javascript"
		src="resources/bootstrap/js/bootstrap.min.js"></script>
	<script>
		function changerHref(dom){
				var href = $('#sjct').attr('data-href'); 
				$('#sjct').attr('href', href+"/"+dom.value);
		}
		
		$(function() {
			bindQuestionKnowledage();
			var result = checkBrowser();
			if (!result) {
				alert("请至少更新浏览器版本至IE8或以上版本");
			}
		});

		function checkBrowser() {
			var browser = navigator.appName;
			var b_version = navigator.appVersion;
			var version = b_version.split(";");
			var trim_Version = version[1].replace(/[ ]/g, "");
			if (browser == "Microsoft Internet Explorer"
					&& trim_Version == "MSIE7.0") {
				return false;
			} else if (browser == "Microsoft Internet Explorer"
					&& trim_Version == "MSIE6.0") {
				return false;
			} else
				return true;
		}

		function bindQuestionKnowledage() {
			$(".knowledge-title").click(function() {
				var ul = $(this).parent().find(".question-list-knowledge");

				if (ul.is(":visible")) {
					$(this).find(".fa-chevron-down").hide();
					$(this).find(".fa-chevron-up").show();

					$(".question-list-knowledge").slideUp();

				} else {
					$(".fa-chevron-down").hide();
					$(".fa-chevron-up").show();

					$(this).find(".fa-chevron-up").hide();
					$(this).find(".fa-chevron-down").show();

					$(".question-list-knowledge").slideUp();
					ul.slideDown();

				}

			});
		}
	</script>

</body>
</html>

